package com.suray.type;

/**
 * 6代车地图载入状态
 */
public enum Rgv60LoadMapStatus {
    INVALID(-1, "无效"),
    FAILED(0, "载入地图失败"),
    SUCCESS(1, "载入地图成功"),
    LOADING(2, "正在载入地图"),
    ;

    Integer value;
    String des;
    Rgv60LoadMapStatus(int value, String des) {
        this.value = value;
        this.des = des;
    }

    public int getValue() {
        return value;
    }

    public static Rgv60LoadMapStatus parseStatus(Integer value) {
        if (value == null) {
            return INVALID;
        }

        for (Rgv60LoadMapStatus rgv60LoadMapStatus : Rgv60LoadMapStatus.values()) {
            if (rgv60LoadMapStatus.value.equals(value)) {
                return rgv60LoadMapStatus;
            }
        }

        return INVALID;
    }

    @Override
    public String toString() {
        return des;
    }
}
